package com.xy.bean;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/4/8 18:41
 * @description
 */

@Component
public class Dog {

    public Dog() {
        System.out.println("dog construcor");
    }

    // 对象创建并赋值之后调用
    @PostConstruct
    public void postConstruct() {
        System.out.println("postConstruct");
    }

    // 销毁前对象调用方法
    @PreDestroy
    public void preDestroy() {
        System.out.println("preDestroy");
    }
}
